<template>
	<view class="pages">
		<view class="dis-flex flex-dir-column card" v-for="(item,index) in customerList" :key="index">
			<image @click="goPreview(0,[item.pictures])" class="IMG" :src="item.pictures" mode="widthFix">
			</image>
			<view class="card-info">
				<view class="m-b-30">{{item.content}}</view>
				<view class="flex-between-row">
					<u-icon size="24" labelSize="36rpx" name="map" :label="item.position"></u-icon>
					<view @click="goSaveAlbum([item.pictures],1)" class="down-button">
						<u-icon color="#fff" labelColor="#fff" size="24" labelSize="36rpx" name="download" label="保存图片">
						</u-icon>
					</view>
				</view>
			</view>
		</view>
		<u-loadmore :status="status" loadingText="正在加载中,上下滑动重新加载" />
		<u-back-top :scrollTop="scrollTop" bottom="150" :customStyle="{'background-color':'#2979ff'}" :iconStyle="{
				'fontSize': '40rpx',
				'color':'#FFF' }"></u-back-top>
	</view>
</template>

<script>
	import {
		getBeautyListDetail
	} from '@/api/list.js'
	export default {
		onPageScroll(e) {
			this.scrollTop = e.scrollTop;
		},
		onLoad() {
			this.getBeautyList()
		},
		onReachBottom() {
			this.getBeautyList()
		},
		data() {
			return {
				status: 'nomore',
				scrollTop: 0,
				customerList: [],
				page: 1
			}
		},
		methods: {
			async getBeautyList() {
				this.status = 'loading'
				const res = await getBeautyListDetail({
					page: this.page,
					limit: 8,
				})
				this.status = 'nomore'
				if (res.code === 200) {
					if (res.data.length === 0) return
					this.page++
					this.customerList.push(...res.data)
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.pages {
		background: #ececec;
		padding: 40rpx 30rpx 160rpx;
	}

	.card {
		padding: 20rpx;
		margin-bottom: 80rpx;
		border-radius: 20rpx;
		box-shadow: 10rpx 10rpx 20rpx 10rpx rgba(0, 0, 0, 0.1);
		background-color: #fff;

		&-info {
			padding: 20rpx;
			margin-top: 30rpx;
			border-radius: 20rpx;
			box-shadow: 0rpx 0rpx 10rpx 2rpx rgba(0, 0, 0, 0.1);
		}
	}

	.IMG {
		width: 100%;
		max-height: 1100px;
		border-radius: 20rpx;
		box-shadow: 0rpx 0rpx 10rpx 2rpx rgba(0, 0, 0, 0.1);
	}

	.down-button {
		padding: 10rpx;
		border-radius: 16rpx;
		background-color: #55aaff;
	}
</style>
